package com.fdb.efp.nls.common.constant;

import java.util.stream.Stream;

/**
 * 马上消费的产品插槽信息
 * 
 * @author huangwb
 * @since 2018年12月28日 下午2:26:52
 * @version 1.0
 */
public enum MSAdaptedSoltEnum {
	/*
	SOLT_APPLY_ACCESS("01020001", "soltApplyAccess", "准入判断服务", "accessRuleService", "2", 1),
	//SOLT_APPLY_PBOC("01020001", "soltApplyPboc", "征信判断服务", "zxRuleService", "2", 2),
	SOLT_APPLY_PBOC("01020001", "soltApplyPboc", "马上二代征信判断服务", "MsZXRuleService", "2", 2),
	SOLT_LOAN_APR("01020001","soltLoanAppr","马上用信审批服务","msLoanApprService","2",2),
	SOLT_APPLY_CUS_CREATE("01020001", "soltAcceptCus", "客户建档服务", "cusCreateService", "2", 3),
	SOLT_LOAN_APR_CALL("01020001", "soltLoanAprCall", "马上贷款审核通知服务", "msLoanApprNoticeService", "2", 4);
	*/
	SOLT_APPLY_ACCESS("01020001", "soltApplyAccess", "准入判断服务", "accessRuleService", "1", 1),
	SOLT_LOAN_APR("01020001","soltLoanAppr","马上用信审批服务","msLoanApprService","1",2),
	SOLT_APPLY_CUS_CREATE("01020001", "soltAcceptCus", "客户建档服务", "cusCreateService", "2", 3),
	SOLT_LOAN_APR_CALL("01020001", "soltLoanAprCall", "马上贷款审核通知服务", "msLoanApprNoticeService", "2", 4),
	SOLT_LOAN_APR_REFUSE_CALL("01020001", "soltLoanAprRefuseCall", "马上贷款审批拒绝通知服务", "msLoanApprRefuseNoticeService", "3", 5);

	private String prdId;// 产品ID
	private String soltCode;// 插槽代码
	private String soltName;// 插槽名称
	private String soltService;// 插槽服务类
	private String soltStage;// 插槽阶段类
	private int soltOrder;// 插槽顺序

	public String getPrdId() {
		return prdId;
	}

	public String getSoltCode() {
		return soltCode;
	}

	public String getSoltName() {
		return soltName;
	}

	public String getSoltService() {
		return soltService;
	}
	
	public String getSoltStage() {
		return soltStage;
	}

	public int getSoltOrder() {
		return soltOrder;
	}

	private MSAdaptedSoltEnum(String prdId, String soltCode, String soltName, String soltService, String soltStage, int soltOrder) {
		this.prdId = prdId;
		this.soltCode = soltCode;
		this.soltName = soltName;
		this.soltService = soltService;
		this.soltStage = soltStage;
		this.soltOrder = soltOrder;
	}

	public static MSAdaptedSoltEnum parse(String prdId, String soltCode) {
		return Stream.of(MSAdaptedSoltEnum.values()).filter(value -> value.prdId.equals(prdId) && value.soltCode.equals(soltCode))
				.findFirst().orElseThrow(RuntimeException::new);

	}

	public boolean validateSoltService(String soltName, String soltService, String soltStage, int soltOrder) {
		return this.soltName.equals(soltName) && this.soltService.equals(soltService) && this.soltStage.equals(soltStage) && this.soltOrder == soltOrder;
	}

}
